import React, { Suspense } from "react";
import { HashRouter as Router, Switch } from "react-router-dom";
import {renderRoutes} from 'react-router-config'
import {routes} from './routes'
import AppHeader from './components/app-footer'
class RouterComponent extends React.Component {
  render() {
    return (
      <React.Fragment>
        <Router>
          <Suspense fallback={<div>loading...</div>}>
            <Switch>
              {renderRoutes(routes)}
            </Switch>
          </Suspense>
          <AppHeader />
        </Router>
      </React.Fragment>
    );
  }
}

export default RouterComponent;
